import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-07-20
 * Time: 11:51
 */
public class Main_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s  = scanner.nextLine();
        s = s.trim();
        String[] strings = s.split(" ");
        int count = 0;
        for (String ss:strings) {
            if(!ss.isEmpty()) {
                count++;
            }
        }
        System.out.println(count);
    }
}
